﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Automation;
using System.Windows;

namespace LEET.LEETCommon.WidgetLookup
{
    public class AEInfo
    {
        internal AutomationElement AE;
        internal string Path;
        internal Rect Location;
        public Dictionary<String, String> allProperties;

        public AEInfo(AutomationElement ae, string path, Rect location)
        {
            AE = ae;
            Path = path;
            Location = location;
        }

        public static List<AutomationElement> AEToList(List<AEInfo> infos)
        {
            List<AutomationElement> aes = new List<AutomationElement>();
            foreach (AEInfo item in infos)
                aes.Add(item.AE);
            return aes;
        }

        public static List<string> PathToList(List<AEInfo> infos)
        {
            List<string> paths = new List<string>();
            foreach (AEInfo item in infos)
                paths.Add(item.Path);
            return paths;
        }

        public static List<Rect> LocationToList(List<AEInfo> infos)
        {
            List<Rect> rects = new List<Rect>();
            foreach (AEInfo item in infos)
                rects.Add(item.Location);
            return rects;
        }
    }
}
